using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class OneWayPlatform : MonoBehaviour
{
    public Vector2 offset;
    public float IgnoreTime = 1;

    private void Awake()
    {
        gameObject.tag = "OneWayPlatform";
        gameObject.layer = LayerMask.NameToLayer("OneWayPlatform");
    }

    public void IgnoreOneWayPlatformLayer() 
    {
        StartCoroutine(Ignore());
    }

    IEnumerator Ignore()
    {
        gameObject.layer = LayerMask.NameToLayer("Default");
        yield return new WaitForSeconds(IgnoreTime);
        gameObject.layer = LayerMask.NameToLayer("OneWayPlatform");
    }

    private void OnDrawGizmos()
    {
        Gizmos.DrawWireSphere(transform.position + (Vector3)offset, 0.1f);
    }
}
